<?php $this->pageTitle = Yii::app()->user->name; ?>
<div class="c_body">
	<div class="u_tabs ajaxLinks">
		<div class="u_tabs_head">
			<a class="u_tab  <?php if($current_tab=='people'){ echo "curr"; } ?>" id="u_search_tab1" href="<?php echo Yii::app()->createUrl('search/index', array('tab'=>'people')); ?>">Люди</a>
			<a class="u_tab  <?php if($current_tab=='groups'){ echo "curr"; } ?>" id="u_search_tab3" href="<?php echo Yii::app()->createUrl('search/index', array('tab'=>'groups')); ?>">Сообщества</a>
			<a class="u_tab  <?php if($current_tab=='audio'){ echo "curr"; } ?>" id="u_search_tab4" href="<?php echo Yii::app()->createUrl('search/index', array('tab'=>'audio')); ?>">Аудиозаписи</a>
			<a class="u_tab  <?php if($current_tab=='video'){ echo "curr"; } ?>" id="u_search_tab5" href="<?php echo Yii::app()->createUrl('search/index', array('tab'=>'video')); ?>">Видеозаписи</a>
		</div>
		<div class="search_block cat_search_block">
			<form action="<?php echo Yii::app()->createUrl('search/index', array('tab'=>$current_tab)); ?>" method="get" id="cat_search" rel="<?php echo Yii::app()->createUrl('search/index', array('tab'=>$current_tab)); ?>">
				<div class="search_btn btn"><input type="submit" value="Найти" id="main_search_button" /></div>
				<div class="search_fld search-input">
					<div class="search_icon"></div>
					<input type="hidden" name="tab" value="<?php echo $current_tab; ?>" />
					<input type="text" name="text" value="<?php if($search){ echo $search; } ?>" placeholder="Начните вводить имя друга" id="search_text" />
				</div>
			</form>
		</div>
	</div>
	
	<div class="tab <?php if($current_tab!='people'){ echo "hidden"; } ?>" id="u_search_tab1_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt"><span class="also"><span>популярные</span> люди</span></p></div>
		</div>
		<?php if($current_tab=='people'){ ?>
			<div class="filter_block">
				<div class="filter_r">
					<form action="<?php echo Yii::app()->createUrl('search/getpeople', array('limit'=>$limit)); ?>" class="filter">
						<div class="form_head">Страна</div>
						<div class="select_block long">
							<select size="1" name="filter_country" id="filter_country">
								<option value="0">Выберите страну</option>
								<?php foreach($countries as $country){ ?>
									<option value="<?php echo $country->id; ?>" <?php if($filter_country == $country->id){ echo 'selected'; } ?>><?php echo $country->name; ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="form_head">Город</div>
						<div class="select_input">
							<input type="text" name="text" value="<?php echo $filter_city; ?>" id="filter_city" />
						</div>		
						<div class="form_head">Место учебы</div>
						<div class="select_input">
							<input type="text" name="text" value="<?php echo $filter_teach; ?>" id="filter_teach" />
						</div>		
						<div class="form_head">Место работы</div>
						<div class="select_input">
							<input type="text" name="text" value="<?php echo $filter_work; ?>" id="filter_work" />
						</div>	
						<div class="form_head">Возраст</div>
						<div class="select_block short">
							<select size="1" name="filter_age_from" id="filter_age_from" class="">
								<option value="0">От</option>
								<?php for ($i = 10; $i <= 50; $i++) { ?>
									<option value="<?php echo $i; ?>" <?php if($filter_age_from == $i){ echo 'selected'; } ?>><?php echo $i; ?></option>
								<?php } ?>
							</select>
						</div>
						<span class="select_bullit">&mdash;</span>
						<div class="select_block short">
							<select size="1" name="filter_age_to" id="filter_age_to" class="">
								<option value="0">До</option>
								<?php for ($i = 10; $i <= 50; $i++) { ?>
									<option value="<?php echo $i; ?>" <?php if($filter_age_to == $i){ echo 'selected'; } ?>><?php echo $i; ?></option>
								<?php } ?>
							</select>
						</div>
						<div class="clear"></div>
						<div class="form_head">Семейное положение</div>
						<div class="select_block long">
							<select size="1" name="filter_love_status" id="filter_love_status">
								<option value="0">Выберите статус</option>
								<?php foreach($loveStatus as $item){ ?>
									<option value="<?php echo $item->id; ?>" <?php if($filter_love_status == $item->id){ echo 'selected'; } ?> class="man_status"><?php echo $item->name_m; ?></option>
								<?php } ?>
							</select>
						</div>						
						<div class="checkbox_row">
							<div class="form_head">Пол</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_female" value="W" />
								<label for="checkbox_female">Женский</label>
							</div>
							<div class="radio_block filter_sex_click">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_male" value="M" />
								<label for="checkbox_male">Мужской</label>
							</div>
							<div class="radio_block filter_sex_click checked">
								<div></div>
								<input type="radio" name="filter_sex" class="radio_item filter_sex" id="radio_other" value="0" checked="checked" />
								<label for="checkbox_other">Любой</label>
							</div>
						</div>
					</form>
				</div>
				<div class="filter_l serchList">
					<?php $this->renderPartial('_peopleList',array(
						'people' => $data,
						'limit' => $limit,
						'offset' => $offset							
					)); ?>					
				</div>
			</div>
		<?php } ?>
	</div>
	
	<div class="tab <?php if($current_tab!='groups'){ echo "hidden"; } ?>" id="u_search_tab3_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt"><span class="also"><span>популярные</span> сообщества</span></p></div>
		</div>
		<?php if($current_tab=='groups'){ ?>
			<div class="filter_block">
				<div class="filter_r">
					<form action="<?php echo Yii::app()->createUrl('search/getgroups', array('limit'=>$limit)); ?>" class="filter">
						<div class="checkbox_row">
							<div class="form_head">Тип сообщества</div>
								<div class="radio_block filter_group_type_click checked">
									<div></div>
									<input type="radio" class="radio_item filter_group_type" id="radio_other" value="0" checked="checked" />
									<label for="radio_other">Любая</label>
								</div>
							<?php foreach($groupTypes as $type){ ?>
								<div class="radio_block filter_group_type_click">
									<div></div>
									<input type="radio" class="radio_item filter_group_type" id="radio_group_<?php echo $type->id; ?>" value="<?php echo $type->id; ?>" />
									<label for="radio_group_<?php echo $type->id; ?>"><?php echo CHtml::encode($type->name); ?></label>
								</div>
							<?php } ?>
						</div>
						<div class="form_head">Страна</div>
						<div class="select_block long">
							<select size="1" name="filter_country" id="filter_country">
								<option value="0">Выберите страну</option>
								<?php foreach($countries as $country){ ?>
									<option value="<?php echo $country->id; ?>"><?php echo $country->name; ?></option>
								<?php } ?>
							</select>
						</div>
					</form>
				</div>
				<div class="filter_l serchList">
					<?php $this->renderPartial('_groupList',array(
						'groups' => $data,
						'limit' => $limit,
						'offset' => $offset
					)); ?>						
				</div>
			</div>
		<?php } ?>
	</div>
	
	<div class="tab <?php if($current_tab!='audio'){ echo "hidden"; } ?>" id="u_search_tab4_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt"><span class="also"><span>популярные</span> аудиозаписи</span></p></div>
		</div>
		<?php if($current_tab=='audio'){ ?>
			<form action="<?php echo Yii::app()->createUrl('search/getaudios', array('limit'=>$limit)); ?>" class="filter"></form>
			<div class="filter_block serchList">
				<?php $this->renderPartial('_audioList',array(
					'audios' => $data,
					'limit' => $limit,
					'offset' => $offset						
				)); ?>					
			</div>
		<?php } ?>
	</div>
	<div class="tab <?php if($current_tab!='video'){ echo "hidden"; } ?>" id="u_search_tab5_">
		<div class="cat_head">
			<div class="cat_head_strip"></div>
			<div class="cat_head_h t"><p class="cat_head_h_txt"><span class="also"><span>популярные</span> видеозаписи</span></p></div>
		</div>
		<?php if($current_tab=='video'){ ?>
			<form action="<?php echo Yii::app()->createUrl('search/getvideos', array('limit'=>$limit)); ?>" class="filter"></form>
			<div class="filter_block serchList">
				<?php $this->renderPartial('_videoList',array(
					'videos' => $data,
					'limit' => $limit,
					'offset' => $offset						
				)); ?>				
			</div>
		<?php } ?>
	</div>
	<div class="clear"></div>
</div>